package bridge;


import java.util.Comparator;


/**
 * @author bajo
 *
 */
public class TeamComparator implements Comparator {


	public int compare(Object o1, Object o2) {
		Team team1 = (Team) o1; 
		Team team2 = (Team) o2;
		double result = team2.getSumOfResults() - team1.getSumOfResults();
		if (result == 0.0) {
			result = team1.getName().compareTo(team2.getName());  
		}
		return (int)result;
	}

}
